package com.yc.yc112plyqnzf.controller;


import com.yc.yc112plyqnzf.vo.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@RestController
public class CheckLogin {


    @GetMapping("checklogin")
    public Result checkLogin(HttpServletRequest request){
        if(!request.getSession().getAttribute("username").toString().isEmpty()){
            return  new Result(1,request.getSession().getAttribute("username"),null);
        }else{
            return new Result(0,"",null);
        }
    }

}
